/****************************************************
	文件：BevBase.cs
	作者：HuskyT
	邮箱：1005240602@qq.com
	日期：2020/8/26 17:52:27
	功能：原子行为基类
*****************************************************/

using System;

namespace AIFramework.HTN
{
    public abstract class BevBase
    {
        protected EntityBase mSelf;

        /// <summary>
        /// 执行 Execute 前执行的委托
        /// </summary>
        protected Action<WorldState> mDoBeforeExecute;

        public BevBase(EntityBase self, Action<WorldState> beforeExecute = default)
        {
            mSelf = self;
            mDoBeforeExecute = beforeExecute == default ? (ws) => { } : beforeExecute;
        }

        public virtual void Execute()
        {
            mDoBeforeExecute?.Invoke(mSelf.CurrentWorldState);
        }
    }
}
